var pattern = /ana/;
var str = "ana is not ggod";
console.log(pattern.test(str));

pattern = new RegExp(".ana");
console.log(pattern.test(str));


function add(num1,num2){
//    var sum = num1+num2;
    sum = num1+num2;
    return sum;
}
add(10,20);
console.log(window.sum);


function funA(){
    var strA = "funA定义的变量strA";
    funB();
    function funB(){
        var strB = "funB定义的变量strB";
        console.log(strA);
        console.log(strB);
        
        
    }
}

funA();

(function(){
    console.log("立即执行函数");
    
})();

+function myFun(){
    console.log("也是立即执行函数");
    
}


function a(){
    var i=0;
    function b(){
        console.log(++i);
        
    }
    return b;
}

var c = a();